/*
1:安装  npm i vue-router
2:导入  import VueRouter from 'vue-router'
3:注册   Vue.use(VueRouter)
4:实例化  const router=new VueRouter({
           routes:[]
        })
5:挂载到new Vue({router})
6:路由出口  router-view标签
*/

import VueRouter from 'vue-router'
import Vue from 'vue'
Vue.use(VueRouter)
import layout from '@/views/layout/layout.vue'
import connect from '@/views/connect.vue'
import our from '@/views/our.vue'

/*
嵌套路由
1:在需要使用嵌套路由的对应组件相应地方加入 router-view标签
2：配制该路由对应子集(children:[{path:"",component:组件名}])

*/

const router = new VueRouter({
  routes: [
    {
      path: '/layout',
      component: layout,
      children: [
        {
          path: '/layout/connect',
          component: connect
        },
        {
          path: '/layout/our',
          component: our
        }
      ]
    }
  ]
})
export default router
